package com.example.lxj.qa.service.impl;

import java.util.List;

import cn.hutool.core.date.DateUtil;
import com.example.lxj.qa.entity.TbObjections;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.example.lxj.qa.mapper.TbObjectionsMapper;
import com.example.lxj.qa.service.ITbObjectionsService;

/**
 * 异议Service业务层处理
 * 
 * @author lxj
 * @date 2024-10-16
 */
@Service
public class TbObjectionsServiceImpl implements ITbObjectionsService 
{
    @Autowired
    private TbObjectionsMapper tbObjectionsMapper;

    /**
     * 查询异议
     *
     * @param id 异议主键
     * @return 异议
     */
    @Override
    public TbObjections selectTbObjectionsById(Long id)
    {
        return tbObjectionsMapper.selectTbObjectionsById(id);
    }

    /**
     * 查询异议列表
     * 
     * @param tbObjections 异议
     * @return 异议
     */
    @Override
    public List<TbObjections> selectTbObjectionsList(TbObjections tbObjections)
    {
        return tbObjectionsMapper.selectTbObjectionsList(tbObjections);
    }

    /**
     * 新增异议
     * 
     * @param tbObjections 异议
     * @return 结果
     */
    @Override
    public int insertTbObjections(TbObjections tbObjections)
    {
        tbObjections.setCreateTime(DateUtil.date());
        return tbObjectionsMapper.insertTbObjections(tbObjections);
    }

    /**
     * 修改异议
     * 
     * @param tbObjections 异议
     * @return 结果
     */
    @Override
    public int updateTbObjections(TbObjections tbObjections)
    {
        tbObjections.setUpdateTime(DateUtil.date());
        return tbObjectionsMapper.updateTbObjections(tbObjections);
    }

    /**
     * 批量删除异议
     * 
     * @param ids 需要删除的异议主键
     * @return 结果
     */
    @Override
    public int deleteTbObjectionsByIds(Long[] ids)
    {
        return tbObjectionsMapper.deleteTbObjectionsByIds(ids);
    }

    /**
     * 删除异议信息
     * 
     * @param id 异议主键
     * @return 结果
     */
    @Override
    public int deleteTbObjectionsById(Long id)
    {
        return tbObjectionsMapper.deleteTbObjectionsById(id);
    }
}
